@echo off
set basename=%1
if "%basename%"=="" (
    set basename="jmcapp"
)
set set filename=%basename%.jar
if exist appjar123 (rd /s /q appjar123) 
if exist %filename% (
    echo start copy
    mkdir appjar123
    move  %filename% appjar123
    cd appjar123
    jar -xvf %filename%
    DEL /F /A /Q %filename%
    xcopy java\org org /y /e /i /q
    rd /s /q java
    xcopy resources\* . /y /e /i /q
    rd /s /q resources
    cd ..
    DEL /F /A /Q eclipse.jar
    jar -cvfM eclipse.jar -C appjar123/ .
    rd /s /q appjar123
    echo success


) else (
    echo file not found
)

if exist eclipse.jar (
    DEL /F /A /Q %filename%
    move eclipse.jar %basename%_lib
    java -jar %basename%_lib/eclipse.jar
)